package legumes.shared.domain;

import java.io.Serializable;

import javax.jdo.annotations.Embedded;

public class Price implements Serializable, Cloneable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private float amount;
	@Embedded private Quantity quantity;

	public Price() {
	}

	public Price(float amount, Quantity quantity) {
		this.amount = amount;
		this.quantity = quantity;
	}

	public Price clone() {
		Price price = new Price();
		price.setAmount(getAmount());
		price.setQuantity(new Quantity(getQuantity()));
		return price;
	}

	@Override
	public String toString() {
		return "[Price amount=" + getAmount() + " quantity=" + getQuantity()
				+ "]";
	}

	public float getAmount() {
		return amount;
	}

	public void setAmount(float amount) {
		this.amount = amount;
	}

	public Quantity getQuantity() {
		return quantity;
	}

	public void setQuantity(Quantity quantity) {
		this.quantity = quantity;
	}

}
